package com.guigu.service.impl;
import com.guigu.dto.ClassifyDTO;
import com.guigu.entity.Classify_detail;
import com.guigu.entity.Classify_detail1;
import com.guigu.entity.Ressksisys;
import com.guigu.mapper.ClassifyMapper;
import com.guigu.service.ClassifyService;
import com.guigu.vo.MemberVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassifyServiceImpl implements ClassifyService {

    @Autowired
    private ClassifyMapper classifyMapper;


    @Override
    public List<MemberVO> queryClassify(ClassifyDTO classifyDTO) {
        return this.classifyMapper.queryClassify(classifyDTO);
    }

    @Override
    public int deleteByClassifyId(int ber_id) {
        try{
            this.classifyMapper.deleteByClassifyId(ber_id);
            this.classifyMapper.deleteByClassifydetailByCid(ber_id);
            return 200;
        }catch (Exception e){
            e.printStackTrace();
            return 400;
        }
    }

    @Override
    public List<Ressksisys> queryriskkAssessment() {
        return this.classifyMapper.queryriskkAssessment();
    }

    @Override
    public Ressksisys queryriskkAssessmentByFileNumber(String FileNumber) {
        return this.classifyMapper.queryriskkAssessmentByFileNumber(FileNumber);
    }

    @Override
    public void insertClassify(Classify_detail1 classify) {
        this.classifyMapper.insertClassify(classify);
    }
}
